﻿using ErrorCode;
using MediatR;
using System.ComponentModel.DataAnnotations;

namespace RabbitTraceability.Api.Applications.Command
{
    /// <summary>
    /// 用户登录命令
    /// </summary>
    public class UserLoginCommand : IRequest<string>
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage = "用户名不能为空")]
        [StringLength(50, MinimumLength = 3, ErrorMessage = "用户名长度必须在3-50个字符之间")]
        public string Username { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        [StringLength(50, MinimumLength = 6, ErrorMessage = "密码长度必须在6-50个字符之间")]
        public string Password { get; set; }
        
        /// <summary>
        /// 验证码GUID
        /// </summary>
        [Required(ErrorMessage = "验证码GUID不能为空")]
        public string CaptchaGuid { get; set; }
        
        /// <summary>
        /// 验证码
        /// </summary>
        [Required(ErrorMessage = "验证码不能为空")]
        [StringLength(10, MinimumLength = 4, ErrorMessage = "验证码长度不正确")]
        public string CaptchaCode { get; set; }
    }
}
